package com.ruoyi.shop.service.impl;

import com.ruoyi.shop.domain.SysOrders;
import com.ruoyi.shop.mapper.SysOrdersMapper;
import com.ruoyi.shop.service.ISysOrdersService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * 订单Service业务层处理
 *
 * @author yanghua
 * @date 2020-10-13
 */
@Service
public class SysOrdersServiceImpl implements ISysOrdersService {
    @Autowired
    private SysOrdersMapper sysOrdersMapper;

    /**
     * 查询订单
     *
     * @param goodId 订单ID
     * @return 订单
     */
    @Override
    public SysOrders selectSysOrdersById(Long goodId) {
        return sysOrdersMapper.selectSysOrdersById(goodId);
    }

    /**
     * 查询订单列表
     *
     * @param sysOrders 订单
     * @return 订单
     */
    @Override
    //@Cacheable("sysOrders")
    public List<SysOrders> selectSysOrdersList(SysOrders sysOrders) {
        System.out.println("444444444444444444444");

        return sysOrdersMapper.selectSysOrdersList(sysOrders);

    }

    /**
     * 新增订单
     *
     * @param sysOrders 订单
     * @return 结果
     */
    @Override
    public int insertSysOrders(SysOrders sysOrders) {
        return sysOrdersMapper.insertSysOrders(sysOrders);
    }

    /**
     * 修改订单
     *
     * @param sysOrders 订单
     * @return 结果
     */
    @Override
    public int updateSysOrders(SysOrders sysOrders) {
        return sysOrdersMapper.updateSysOrders(sysOrders);
    }

    /**
     * 批量删除订单
     *
     * @param goodIds 需要删除的订单ID
     * @return 结果
     */
    @Override
    public int deleteSysOrdersByIds(Long[] goodIds) {
        return sysOrdersMapper.deleteSysOrdersByIds(goodIds);
    }

    /**
     * 删除订单信息
     *
     * @param goodId 订单ID
     * @return 结果
     */
    @Override
    public int deleteSysOrdersById(Long goodId) {
        return sysOrdersMapper.deleteSysOrdersById(goodId);
    }
}
